/*
 * @Date: 2021-09-12 19:21:05
 * @Author: Acckno1
 * @LastEditTime: 2021-09-12 19:23:16
 * @Description: 
 */
#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 1010, M = 1e6;

int n, m, k;
int p[N];

struct Edge {
    int a, b;
}e[M];

// 并查集
int find (int x) {
    if (p[x] != x) p[x] = find(p[x]);
    return p[x];
}

int main() {
    cin >> n >> m >> k;
    for (int i = 0; i < m; i ++ ) cin >> e[i].a >> e[i].b;
    for (int _ = 0; _ < k; _ ++ ) {
        int query;
        cin >> query;
        int cnt = n - 1; // 不算query 有 n - 1 个连通块
        for (int i = 1; i <= n; i ++ ) p[i] = i;
        for (int i = 0; i < m; i ++ ) {
            int a = e[i].a, b = e[i].b;
            if (a != query && b != query) {
                int pa = find(a), pb = find(b);
                if (pa != pb) p[pa] = pb, cnt -- ; // 每次合并两个连通块， 连通块的数量减1
            } 
        }
        cout << cnt - 1 << endl; 
    }
    return 0;
}